<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="java.util.HashMap"%>
<%@ page import="oneroom.admin.oneroom.roomModel" %>
<%@ page import="oneroom.admin.board.boardModel" %>
<%@ page import="oneroom.admin.code.codeModel" %>
<jsp:useBean id="room" scope="page" class="oneroom.admin.oneroom.roomDao" />
<jsp:useBean id="board" scope="page" class="oneroom.admin.board.boardDao" />
<jsp:useBean id="code" scope="page" class="oneroom.admin.code.codeDao" />
<%
	//session 등급, 사용자구분값 처리
	HashMap	paramMap	= new HashMap();
	paramMap.put("authorize","1");
	paramMap.put("grade","1");
	paramMap.put("id","kwon");   
	
	HashMap	returnMap	= new HashMap();
	returnMap	= room.getSelectCnt(paramMap);
	String one_cnt		=	(String)returnMap.get("one_cnt") == null ? "0":(String)returnMap.get("one_cnt");
	String two_cnt		=	(String)returnMap.get("two_cnt") == null ? "0":(String)returnMap.get("one_cnt");
	String office_cnt	=	(String)returnMap.get("office_cnt") == null ? "0":(String)returnMap.get("one_cnt");
	
	List codeList = code.getDtlList("200");
	List noticeList = board.getSelectList("2");	
	List freeList = board.getSelectList("1");	
	List adviceList = board.getSelectList("4");	
%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>마이페이지</title>
<script type="text/javascript" src="/admin/js/default.js"></script>
<script type="text/javascript" src="/admin/js/jquery-1.3.2.min.js"></script>
<link href="/admin/css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- Header  Start -->
<div id="bodywrap">
<div class="all-wrap">
<%@ include file="/admin/common/top.jsp" %>
<div id="right-wrap">
<%@ include file="/admin/common/navi.jsp" %>
<!--Contents Start-->
<div id="content">
<div class="path"><span>home</span> >  마이페이지 </div>
<h4>마이페이지</h4>
<p class="sub-text">마이페이지 하실 수 있습니다.</p>
<p class="board-total">원룸:<span>50/<%=one_cnt%></span>건,  투/쓰리룸:<span>50/<%=two_cnt%></span>건,  오피스텔:<span>50/<%=office_cnt%></span>건</p>
<div class="btn-all-align2 pd-b20">
<span class="btn-align"><input type="button" value="원룸" class="btn-bg-gray"  id="lstBtn" /></span>
<span class="btn-align"><input type="button" value="투/쓰리룸" class="btn-bg-gray"  id="lstBtn" /></span>
<span class="btn-align"><input type="button" value="오피스텔" class="btn-bg-gray"  id="lstBtn" /></span>
<span class="btn-align"><input type="button" value="매매" class="btn-bg-gray"  id="lstBtn" /></span>
</div>


<table class="list-normal" cellpadding="0" cellspacing="0" summary="EVENT" >
	<caption>마이페이지 목록</caption>
	<col width="50px" />
	<col width="100px" />
	<col/>
	<col width="80px" />   
	<col width="80px" /> 
	<thead>
    <tr>
      <th scope="col" >No</th>
      <th scope="col" >구분</th>
      <th scope="col" >제목</th>
      <th scope="col" >등록자</th>
      <th scope="col" >등록일</th>
    </tr>
  </thead>
  <tbody>
<%
	if(noticeList != null && noticeList.size() > 0){
		int gcount = noticeList.size();
		for(int i = 0; i<noticeList.size(); i++){
			boardModel model = (boardModel)noticeList.get(i);
%>
	<tr>
		<td><%=gcount%></td>
		<td>
			<%
				for(int j = 0; j<codeList.size(); j++){
					codeModel codemode = (codeModel)codeList.get(j);
			%>
				<%if(model.getBoard_kind().equals(codemode.getCode())){out.print(codemode.getCodename());} %>
			<%
				}
			%>
		</td>
		<td><a href="javascript:goView('<%=model.getData_id() %>')"><%=model.getTitle() %></a></td>
		<td><%=model.getReg_id() %></td>
		<td><%=model.getReg_date() %></td>
	</tr>
<%
		gcount= gcount -1;
		}
	}else{
%>
	<tr><td colspan="5">등록된 내용이 없습니다.</td></tr>
<%
	}
%>
  </tbody>
</table>

<div class="btn-all-align2 pd-b20">
<span class="btn-align"><input type="button" value="목록" class="btn-bg-gray"  id="lstBtn" /></span>
</div>
<table class="list-normal" cellpadding="0" cellspacing="0" summary="EVENT" >
	<caption>마이페이지 목록</caption>
	<col width="50px" />
	<col width="100px" />
	<col/>
	<col width="80px" />   
	<col width="80px" /> 
	<thead>
    <tr>
      <th scope="col" >No</th>
      <th scope="col" >구분</th>
      <th scope="col" >제목</th>
      <th scope="col" >등록자</th>
      <th scope="col" >등록일</th>
    </tr>
  </thead>
  <tbody>
<%
	if(freeList != null && freeList.size() > 0){
		int gcount = freeList.size();
		for(int i = 0; i<freeList.size(); i++){
			boardModel model = (boardModel)freeList.get(i);
%>
	<tr>
		<td><%=gcount%></td>
		<td>
			<%
				for(int j = 0; j<codeList.size(); j++){
					codeModel codemode = (codeModel)codeList.get(j);
			%>
				<%if(model.getBoard_kind().equals(codemode.getCode())){out.print(codemode.getCodename());} %>
			<%
				}
			%>
		</td>
		<td><a href="javascript:goView('<%=model.getData_id() %>')"><%=model.getTitle() %></a></td>
		<td><%=model.getReg_id() %></td>
		<td><%=model.getReg_date() %></td>
	</tr>
<%
		gcount= gcount -1;
		}
	}else{
%>
	<tr><td colspan="5">등록된 내용이 없습니다.</td></tr>
<%
	}
%>
  </tbody>
</table>

<div class="btn-all-align2 pd-b20">
<span class="btn-align"><input type="button" value="목록" class="btn-bg-gray"  id="lstBtn" /></span>
</div>
<table class="list-normal" cellpadding="0" cellspacing="0" summary="EVENT" >
	<caption>마이페이지 목록</caption>
	<col width="50px" />
	<col width="100px" />
	<col/>
	<col width="80px" />   
	<col width="80px" /> 
	<thead>
    <tr>
      <th scope="col" >No</th>
      <th scope="col" >구분</th>
      <th scope="col" >제목</th>
      <th scope="col" >등록자</th>
      <th scope="col" >등록일</th>
    </tr>
  </thead>
  <tbody>
<%
	if(adviceList != null && adviceList.size() > 0){
		int gcount = adviceList.size();
		for(int i = 0; i<adviceList.size(); i++){
			boardModel model = (boardModel)adviceList.get(i);
%>
	<tr>
		<td><%=gcount%></td>
		<td>
			<%
				for(int j = 0; j<codeList.size(); j++){
					codeModel codemode = (codeModel)codeList.get(j);
			%>
				<%if(model.getBoard_kind().equals(codemode.getCode())){out.print(codemode.getCodename());} %>
			<%
				}
			%>
		</td>
		<td><a href="javascript:goView('<%=model.getData_id() %>')"><%=model.getTitle() %></a></td>
		<td><%=model.getReg_id() %></td>
		<td><%=model.getReg_date() %></td>
	</tr>
<%
		gcount= gcount -1;
		}
	}else{
%>
	<tr><td colspan="5">등록된 내용이 없습니다.</td></tr>
<%
	}
%>
  </tbody>
</table>
<div class="btn-all-align2 pd-b20">
<span class="btn-align"><input type="button" value="목록" class="btn-bg-gray"  id="lstBtn" /></span>
</div>
</div>


<!--Contents End-->
</div>
</div>
</div>
<!--Footer Start-->
<%@ include file="/admin/common/bottom.jsp" %>
<!--Footer End-->
</body>
</html>
